In general, there is known a technology for measuring a distance to an object to be measured using a plurality of images with different view points. For example, Citation 1 describes a distance calculation method using a technique being referred to as stereo matching.
In such a stereo matching technology, a distance is calculated from a plurality of disparity images along a horizontal (H direction) or a vertical direction (V direction) within the images by determining a phase difference between the disparity images. The phase difference is determined by sequentially moving local areas (unit areas) of objects to be compared in a horizontal direction, and detecting a position offset (pixel offset) between the disparity images having most correlated unit areas within a comparison range. Also, it is possible to calculate the distance from the plurality of disparity images along a direction at any angle within the images.